'use strict';

define([
    'app.routers',
    'workspace/workspace.routers'
], function(appRouters, workspaceRouters) {
    //配置路由规则
    function configRouter(ngModule, routersConfig) {
        ngModule.config(function($stateProvider) {
            for (var i = 0; i < routersConfig.length; i++) {
                $stateProvider.state(routersConfig[i]);
            }
        });
    }

    //根模块
    var rootModule = angular.module("NiceFishRootModule", ["ui.router", "login.module", "workspace.module"]);
    configRouter(rootModule, appRouters);
    configRouter(rootModule, workspaceRouters);
    return rootModule;
});
